#include <stdio.h>
void InsertionSort(int *a, int len);
int main()
{
   /*  Write C code in this online editor and run it. */
   int a[3] = {3,2,1};
	int len;
	len = sizeof(a)/sizeof(int);
	InsertionSort(a, len);
   
   return 0;
}

void InsertionSort(int *a, int len)
{
	int i, j, k, x;
	printf("%d\n", sizeof(a)/sizeof(int));
	printf("%d\n", sizeof(int*));
	for(i = 1; i < len; i++)
	{
		x = a[i];
		j = i - 1;
		while(j>=0)
		{
			if(x < a[j])
			{
				a[j+1] = a[j];
				j--;
			}
			else
			{
				break;
			}
		}
		a[j+1] = x;
		
		for(k = 0; k < len; k++)
		{
			printf("%d ", a[k]);
		}
		printf("\n");	
	}
	
	return;
}